//
//  UIColor+HexColor.h
//  QNReuseTool
//
//  Created by rsh on 2019/10/15.
//  Copyright © 2019年 rsh. All rights reserved.
//

#import <UIKit/UIKit.h>
@interface UIColor (HexColor)

//RGB转换

/**
 快速生成RGB颜色
 
 @param r R
 @param g G
 @param b B
 @param alpha 透明度
 @return RGB颜色
 */
+ (UIColor *)gp_colorWithRed:(CGFloat)r green:(CGFloat)g blue:(CGFloat)b alpha:(CGFloat)alpha;


/**
 生成随机颜色
 
 @return 随机颜色
 */
+ (UIColor *)gp_randomColor;


/**
 Hex转UIColor
 
 @param hexString Hex字符串
 @return UIColor
 */
+ (UIColor *)colorWithHexString:(NSString *)hexString;

/**
 Hex转UIColor
 
 @param hexString Hex字符串
 @param alphaValue 透明度
 @return UIColor
 */
+ (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alphaValue;

/**
 UIColor转#ffffff格式的字符串
 */
+ (NSString *)hexStringFromColor:(UIColor *)color;

+ (UIColor *)hexColor:(NSString *)hexColor;


/**
 根据十六进制字符串生成RGB颜色（兼容#FFffFF、#FFffFFff、0xFFffFF、0xFFffFFff）
 
 @param hexStr 十六进制颜色字符串
 @return RGB颜色
 */
+ (UIColor *)colorWithHexStr:(NSString *)hexStr;


+ (UIColor *)hexAlphaColor:(NSString *)hexColor;

@end
